{% extends "monitor/storm_base.html" %}

{% block storm_content %}
    <table class="table table-striped table-bordered">
        <thead>
        <tr>
            <th>job</th>
            <th>task id</th>
            <th>task entry</th>
            <th>last success</th>
            <th>supervisor</th>
        </tr>
        </thead>
        <tbody>
        {% for task in tasks %}
            <tr>
                {% if task.job.name == "metricserver" %}
                    <td><a href="/monitor/cluster/{{ cluster.id }}/builtin_metrics/?type=Spout">{{ task.job.name }}</a></td>
                    <td><a href="/monitor/cluster/{{ cluster.id }}/builtin_metrics/?type=Spout">{{ task.task_id }}</a></td>
                {% else %}
                    <td>{{ task.job.name }}</td>
                    <td>{{ task.task_id }}</td>
                {% endif %}
                <td><a href="http://{{ task.host }}:{{ task.port }}/">{{ task.host }}:{{ task.port }}</a></td>
                <td>{{ task.last_success_time }}
                    {% if task.health %}
                        <img src="{{ STATIC_URL }}/ok.png" width="24" alt="Big Boat"/>
                    {% else %}
                        <img src="{{ STATIC_URL }}/alert.png" width="24" alt="Big Boat"/>
                    {% endif %}
                </td>
                <td><a href="http://{{ task.host }}:{{supervisor_port}}/">{{ task.host }}:{{supervisor_port}}</a></td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% endblock %}
